<template>
<div>
  <h1>Vue Router Demo</h1>
  <button @click="back()">后退</button>
  <button @click="forward()">前进</button>
  <button @click="goTest(-3)">go查看测试（后退3步）</button>
  <button @click="goTest(2)">go查看测试（前进2步）</button>

  <br>
  <br>
</div>
</template>

<script>
    export default {
        name: "Banner",
      methods:{
        back(){
          this.$router.back()
        },
        forward(){
          this.$router.forward()
        },
        goTest(value){
          this.$router.go(value)
        }
      }
    }
</script>

<style scoped>
h1{
  border-bottom: 1px solid #ccc;
}
</style>
